package org.example.strategy;

import java.util.LinkedList;

public class ListStrategy implements EditorStrategy{
    private LinkedList<String> contents;
    public ListStrategy(LinkedList<String> contents){
        this.contents = contents;
    }
    @Override
    public void performAction() {
        int i = 1;
        if (contents == null){
            System.out.println("Please load a file first!");
            return;
        }
        for (String line:contents){
            System.out.println(i + ":    \t" + line);
            i += 1;
        }
    }
}
